import java.util.Scanner;

public class program5{
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Enter the subtotal and a gratuity rate: ");
        double sub = in.nextDouble();
        double rate = in.nextDouble();
        double tip = sub * rate / 100;
        double total = sub + tip;
        System.out.printf("The gratuity is $%.1f and total is $%.1f%n", tip, total);
    }
}